<!--  -->
<template>
	<div class="container">
		<cu-custom :bgImage="bgImage" :needBack="true" bgColor="bgNormal" topTitle="申请填报" titleClass="commTitleWhite"
			backIconColor="#fff"></cu-custom>
		<view class="content" :style="{ height: getHeight() }">
			<!-- <view class="title">社会组织申请 </view>
			<view class="time">
				<view class=""> 创建时间</view>
				<view class="">{{ detail.createTime }} </view>
			</view> -->
			<view class="title">基本信息 </view>

			<view class="time type">
				<view class=""> 组织名称</view>
				<view class="">{{ detail.organizationName }} </view>
			</view>
			<view class="time type">
				<view class=""> 组织类型</view>
				<view class="">{{ detail.socialOrganizationType }} </view>
			</view>
			<view class="time type">
				<view class=""> 创建人</view>
				<view class="">{{ detail.createUserName }} </view>
			</view>
			<!-- <view class="time type">
				<view class=""> 生效时间</view>
				<view class="">{{detail.startDate}} ~ {{detail.endDate}}</view>
			</view> -->
			<view class="more">
				<view class=""> 填报信息</view>
				<view class="" @click="toMore">查看更多> </view>
			</view>
			<view class="score">
				<view class="">
					<text class=""> {{ detail.recordSelfScoreSum }} </text>
					<text class=""> 自评得分 </text>
				</view>
				<view class="">
					<text class=""> {{ detail.passMark }} </text>
					<text class=""> 及格分数 </text>
				</view>
				<view class="">
					<text class=""> {{ detail.declarationlevel }}</text>
					<text class=""> 申请级别 </text>
				</view>
			</view>
			<view class="score mt_20">
				<!-- <view class="">
					<text class="">
						<text class="fc_477EF5"> {{ detail.newScore || 0}}</text>
						<text class="">/{{ detail.managementTotalPoint }}</text></text>
					<text class=""> 积分 </text>
				</view> -->
				<view class="">
					<text class="fc_477EF5"> {{detail.recordScoreZhidaoSum || '暂无'}} </text>
					<text class=""> 指导打分 </text>
				</view>
				<view class="">
					<text class="fc_477EF5"> {{detail.recordScoreSum || '暂无'}} </text>
					<text class=""> 专家打分 </text>
				</view>
			</view>
			<!-- <view class="title">专家批注 </view>
			<view class="annotations">{{detail.annotations || '暂无批注'}}</view> -->
		</view>
	</div>
</template>

<script>
	import {
		getDeclarationInfoDetail,
		getDeclaration,
		
	} from "@/api/report";
	import {
		getIsAllOver,
		noMeaning
	} from "@/api/expert.js";
	export default {
		data() {
			return {
				detail: {},
				userInfo: uni.getStorageSync("userInfo"),
				currentReportId: uni.getStorageSync("currentReportId"),
				currentDeclarationSystemId: uni.getStorageSync("currentDeclarationSystemId"),
				declarationDetail: {}
			};
		},
		onLoad(options) {
			console.log(options, 1111)
			this.getData(options.id)
			this.getTXDetail()
		},
		methods: {
			async getData(val) {
				getDeclarationInfoDetail(val).then((res) => {
					if (res.code == 200) {
						// console.log("res===", res);
						this.detail = res.data;
					} else {
						uni.showToast({
							title: res.msg,
							icon: "none"
						});
					}
				});
				let res2 = await noMeaning({declarationInfoId:val})
			},

			async getTXDetail() {
				let id = uni.getStorageSync("currentDeclarationSystemId")
				let res = await getDeclaration(id)
				this.declarationDetail = res.data
				
			},
			getHeight() {
				return `calc(100vh - ${this.CustomBar}px)`;
			},
			// 查看更多
			async toMore() {
				let userType = this.userInfo.roles[0].roleKey
				console.log(userType)
				if (userType == 'GUIDANCE_EXPERT' || userType == 'admin') {
					uni.navigateTo({
						url: "/packageB/applicationMaterials/more",
					});
					// if (this.declarationDetail.status == 2) {
					// 	uni.navigateTo({
					// 		url: "/packageB/applicationMaterials/more",
					// 	});
					// } else if (this.declarationDetail.status == 1) {
					// 	uni.showToast({
					// 		title: "填报还未开始",
					// 		icon: "none",
					// 	});
					// } else if (this.declarationDetail.status == 3) {
					// 	uni.showToast({
					// 		title: "专家评审中，已结束指导",
					// 		icon: "none",
					// 	});
					// } else if (this.declarationDetail.status == 4) {
					// 	uni.showToast({
					// 		title: "分数公示期，已结束指导",
					// 		icon: "none",
					// 	});
					// } else if (this.declarationDetail.status == 5) {
					// 	uni.showToast({
					// 		title: "该申报已经结束",
					// 		icon: "none",
					// 	});
					// }

				} else {
					if (this.declarationDetail.status == 3) {
						uni.navigateTo({
							url: "/packageB/applicationMaterials/more",
						});
					} else if (this.declarationDetail.status == 1) {
						uni.showToast({
							title: "填报还未开始",
							icon: "none",
						});
					} else if (this.declarationDetail.status == 2) {
						uni.showToast({
							title: "填报中，还未开始打分",
							icon: "none",
						});
					} else if (this.declarationDetail.status == 4) {
						uni.showToast({
							title: "分数公示期，打分已结束",
							icon: "none",
						});
					} else if (this.declarationDetail.status == 5) {
						uni.showToast({
							title: "该申报已经结束",
							icon: "none",
						});

					}
				}
			},
		},
	};
</script>
<style lang="scss" scoped>
	.container {
		font-size: 28rpx;
		color: #666;

		.content {
			overflow-y: scroll;

			.title {
				padding-left: 29rpx;
				line-height: 85rpx;
				color: #333;
			}

			.time {
				padding-left: 29rpx;
				line-height: 97rpx;
				display: flex;
				align-items: center;
				background: #fff;

				view:first-child {
					width: 112rpx;
				}

				view:last-child {
					margin-left: 81rpx;
				}
			}

			.type {
				border-bottom: 2rpx solid #f5f5f5;
			}

			.more {
				padding: 0 29rpx;
				line-height: 85rpx;
				color: #333;
				display: flex;
				justify-content: space-between;

				view:last-child {
					color: #477ef5;
				}
			}

			.score {
				padding: 58rpx 0;
				display: flex;
				background: #fff;

				&>view {
					flex: 1;
					display: flex;
					flex-direction: column;
					border-right: 2rpx solid #f5f5f5;

					&>text:first-child {
						font-size: 34rpx;
						opacity: 0.9;
						font-weight: bold;
						color: #333;
					}

					&>text:last-child {
						font-size: 28rpx;
						color: #999999;
						font-size: 26rpx;
						margin-top: 28rpx;
					}

					text {
						text-align: center;
					}
				}
			}

			.mt_20 {
				margin-top: 20rpx;

				.fc_477EF5 {
					color: #477ef5 !important;
				}
			}
		}
	}

	.annotations {
		background: #ffffff;
		padding: 30rpx;
	}
</style>